home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / oleo-1_4.lha / oleo-1.4 / configure.in < prev    next >
Text File  |  1993-05-23  |  6KB  |  189 lines

  1. dnl tempnam needs replaced on some systems e.g. next
  2. dnl
  3. dnl Look for the X11 include files in various places, if they're
  4. dnl not in the compiler's path.  Substitute for `xincludedir' and
  5. dnl `xlibdir'.  Perhaps we need different checks for Xt and Xaw?
  6. define(AC_X11_LOCATION,
  7. [echo checking for X11 headers and libraries
  8. dir=""
  9. AC_TEST_CPP([#include <X11/Intrinsic.h>], :,
  10.   if test -r /usr/local/[[include]]/X11/Intrinsic.h; then
  11.     dir=/usr/local/[[include]]
  12.  
  13.   elif test -r /usr/[[include]]/X11R4/X11/Intrinsic.h; then
  14.     dir=/usr/[[include]]/X11R4
  15.   elif test -r /usr/[[include]]/X11R5/X11/Intrinsic.h; then
  16.     dir=/usr/[[include]]/X11R5
  17.  
  18.   elif test -r /usr/lpp/X11/Xamples/[[include]]/X11/Intrinsic.h; then
  19.     dir=/usr/lpp/X11/Xamples/[[include]]
  20.  
  21.   elif test -r /usr/X11/[[include]]/X11/Intrinsic.h; then
  22.     dir=/usr/X11/[[include]]
  23.   elif test -r /usr/X11R5/[[include]]/X11/Intrinsic.h; then
  24.     dir=/usr/X11R5/[[include]]
  25.  
  26.   elif test -r /usr/openwin/[[include]]/X11/Intrinsic.h; then
  27.     dir=/usr/openwin/[[include]]
  28.   elif test -r /usr/openwin/share/[[include]]/X11/Intrinsic.h; then
  29.     dir=/usr/openwin/share/[[include]]
  30.  
  31.   elif test -r /usr/[[include]]/X11/Intrinsic.h; then
  32.     dir= # everyone's cc searches /usr/include, right?
  33.   else
  34.     no_x=t
  35.   fi
  36. )
  37. dnl Can't use AC_SUBST inside AC_TEST_CPP.
  38. if test -n "$dir"; then
  39.   xincludedir=-I$dir
  40.   echo "(using $xincludedir)"
  41. elif test -n "$no_x"; then 
  42.   # Not all programs may use this symbol, but it won't hurt to define it.
  43.   xincludedir=-DX_DISPLAY_MISSING
  44. fi
  45. AC_SUBST(xincludedir)
  46. #
  47. # Now check for the libraries.  Amazing how every single X vendor puts
  48. # these in a different place, and all because MIT thought they should go
  49. # in /usr/lib.
  50. dir1=""
  51. if test -r /usr/local/lib/libXt.a; then
  52.   dir1=/usr/local/lib
  53.  
  54. elif test -r /usr/lib/X11R4/libXt.sl; then
  55.   dir1=/usr/lib/X11R4
  56. elif test -r /usr/lib/X11R4/libXt.a; then
  57.   dir1=/usr/lib/X11R4
  58. elif test -r /usr/lib/X11R5/libXt.a; then
  59.   dir1=/usr/lib/X11R5
  60.  
  61. elif test -r /usr/lpp/X11/Xamples/lib/Xt/libXt.a; then
  62.   dir1=/usr/lpp/X11/Xamples/lib/Xt
  63.  
  64. elif test -r /usr/X11/lib/libXt.a; then
  65.   dir1=/usr/X11/lib
  66. elif test -r /usr/X11R5/lib/libXt.a; then
  67.   dir1=/usr/X11R5/lib
  68.  
  69. elif test -r /usr/openwin/lib/libXt.a; then
  70.   dir1=/usr/openwin/lib
  71. elif test -r /usr/openwin/lib/libXt.so; then
  72.   dir1=/usr/openwin/lib
  73.  
  74. fi
  75. dir2=""
  76. if test -r /usr/lpp/X11/Xamples/lib/Xmu/libXmu.a; then
  77.   dir2=/usr/lpp/X11/Xamples/lib/Xmu
  78. fi
  79. #
  80. # It would be nice to have a more robust check for the -R ld option then
  81. # just checking for Solaris.  The parentheses elide `uname: not found'.
  82. # It would also be nice to do this for all -L options, not just this one.
  83. if test -n "$dir1"; then
  84.   xlibdir=-L$dir1
  85.   if test "`(uname) >/dev/null 2>&1`" = SunOS && uname -r | grep '^5'; then
  86.     xlibdir="$xlibdir -R$dir1"
  87.   fi
  88.   #
  89.   # Don't need all that stuff for dir2, since it only gets used on AIX.
  90.   test -n "$dir2" && xlibdir="$xlibdir -L$dir2"
  91. fi
  92. #
  93. # Check for additional X libraries.
  94. # Since we already have an explicit check for POSIXified ISC, use it.
  95. if test -n "$ISC"; then
  96.   wlibs="$wlibs -lnsl_s -linet"
  97.   echo "(adding -lnsl_s -linet to wlibs)"
  98. else
  99.   # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
  100.   # libraries were built with DECnet support.  And karl@cs.umb.edu's Alpha
  101.   # needs dnet_stubs.
  102.   AC_HAVE_LIBRARY(dnet,
  103.     [wlibs="$wlibs -ldnet"
  104.      have_dnet=t
  105.      echo "(adding -ldnet to wlibs)"])
  106.   if test -z "$have_dnet"; then
  107.     AC_HAVE_LIBRARY(dnet_stub,
  108.       [wlibs="$wlibs -ldnet_stub"
  109.        echo "(adding -ldnet_stub to wlibs)"])
  110.   fi
  111.   # lieder@skyler.mavd.honeywell.com says without -lsocket,
  112.   # socket/setsockopt and other routines are undefined under SCO ODT 2.0.
  113.   AC_HAVE_LIBRARY(socket,
  114.     [wlibs="$wlibs -lsocket"
  115.      echo "(adding -lsocket to wlibs)"])
  116. fi
  117. test -n "$xlibdir" && echo "(using $xlibdir)"
  118. AC_SUBST(xlibdir)dnl
  119. AC_SUBST(wlibs)dnl
  120. ])dnl
  121. dnl Process this file with autoconf to produce a configure script.
  122. dnl
  123. AC_INIT(io-term.c)
  124. AC_SUBST(LIBS)dnl
  125. dnl Checks for programs:
  126. AC_PROG_CC
  127. AC_PROG_CPP
  128. AC_PROG_YACC
  129. AC_PROG_INSTALL
  130.  
  131. dnl Checks for UNIX variants that set `DEFS':
  132. AC_ISC_POSIX
  133. AC_AIX
  134.  
  135. dnl Checks for header files:
  136. AC_STDC_HEADERS
  137. AC_UNISTD_H
  138. AC_DIR_HEADER
  139. AC_HAVE_HEADERS(sys/time.h string.h memory.h sys/select.h)
  140. AC_X11_LOCATION
  141. AC_HEADER_CHECK(X11/X.h, AC_DEFINE(HAVE_X11_X_H); LIBS="$LIBS -lX11")
  142.  
  143. dnl checks for functions
  144. AC_RETSIGTYPE
  145. AC_ALLOCA
  146. AC_REPLACE_FUNCS(random strftime mktime xmalloc)
  147.  
  148. AC_CONST
  149.  
  150. dnl Replace vfprintf and vsprintf.
  151. dnl If either needs to be replaced, replace _doprnt.
  152. need_doprnt=
  153. AC_COMPILE_CHECK([vfprintf], , [vfprintf();], ,
  154. [LIBOBJS="$LIBOBJS vfprintf.o"; need_doprnt=1])
  155. AC_COMPILE_CHECK([vsprintf], , [vsprintf();], ,
  156. [LIBOBJS="$LIBOBJS vsprintf.o"; need_doprnt=1])
  157. if test $need_doprnt; then
  158.   AC_REPLACE_FUNCS(_doprnt)
  159. fi
  160.  
  161. AC_HAVE_LIBRARY(termcap, \
  162.         LIBS="$LIBS -lcurses -ltermcap", \
  163.         AC_HAVE_LIBRARY(termlib, \
  164.                 LIBS="$LIBS -lcurses -ltermlib", \
  165.                 LIBS="$LIBS -lcurses"))
  166.  
  167. LIBS_save="$LIBS"
  168. LIBS="$LIBS -lm"
  169. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  170. AC_HAVE_FUNCS(rint rename \
  171.           getcap stricmp strincmp \
  172.           strdup strstr strftime mktime)
  173. AC_COMPILE_CHECK([cbreak], [#include <curses.h>], [cbreak();],
  174. AC_DEFINE(HAVE_CBREAK))
  175. LIBS="$LIBS -lm"
  176. AC_COMPILE_CHECK([hypot], [], [hypot();],
  177. AC_DEFINE(HAVE_HYPOT))
  178. LIBS="$LIBS_save"
  179. AC_COMPILE_CHECK([bogus definition of __GNUC__], [static int x = 54;], [
  180. #if defined (__GNUC__) && __GNUC__ >= 2
  181. exit (__extension__ x);
  182. #endif
  183. ],
  184. [echo looks ok],
  185. [DEFS="$DEFS -D__extension__"])
  186. AC_OUTPUT(Makefile)
  187.